#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright [Gtlions Lai].
# Create Date:
# Update Date:
__authors__ = '"Gtlions Lai" <gtlions.l@qq.com>'

"""Summary about the module or script.


Summary about function.


  Class: about class.
  Function(): about function.
"""
import os
import sys
import ConfigParser

cf = ConfigParser.ConfigParser()
exeruningpath = os.path.dirname(sys.executable)
# exepath = os.path.dirname(sys.path[0])
exepath = os.path.dirname(__file__)
exepath = os.path.split(os.path.realpath(__file__))[0]

# print exepath,os.path.join(exepath, "config.ini")
if os.path.isfile(os.path.join(exepath, "config.ini")):
    cfile = os.path.join(exepath, "config.ini")
else:
    cfile = os.path.join(exeruningpath, "config.ini")
# cf = ConfigParser.ConfigParser()
# cfile = os.path.join(os.path.split(os.path.realpath(__file__))[0], "config.ini")


cf.read(cfile)

host = cf.get("database", "host")
port = cf.get("database", "port")
database = cf.get("database", "database")
user = cf.get("database", "user")
password = cf.get("database", "password")
